package com.homedo.odin.solution.controller.wap;

import com.homedo.core.common.base.controller.BaseController;
import com.homedo.core.common.base.dto.ResultData;
import com.homedo.odin.solution.contract.wap.SolutionDownloadsResp;
import com.homedo.odin.solution.service.bizservice.wap.WapDownloadsBizService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: zhaoxudong
 * @date: 2018/3/29 15:13
 * @Description:
 */
@Api(description = "下载接口", tags = {"Downloads"}, produces = MediaType.APPLICATION_JSON_VALUE)
@RestController
@RequestMapping("/wap/downloads")
public class WapDownloadsController extends BaseController<WapDownloadsBizService> {

    @ApiOperation(value = "M站_获取方案下载最新动态", notes = "M站_获取方案下载最新动态", response = SolutionDownloadsResp.class)
    @GetMapping
    public ResultData solutions(@ApiParam("当前页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
            @ApiParam("每页数量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
        SolutionDownloadsResp resp = baseService.solutions(pageNum, pageSize);
        return ResultData.newInstance(resp);
    }
}
